package sep.test;

import static com.googlecode.javacv.cpp.opencv_imgproc.CV_BGR2GRAY;
import static com.googlecode.javacv.cpp.opencv_imgproc.cvCanny;
import static com.googlecode.javacv.cpp.opencv_imgproc.cvCvtColor;

import com.googlecode.javacv.cpp.opencv_core.IplImage;

public class IdaCannyEdgeFilter implements IdaEdgeFilter {

	private static final long serialVersionUID = -8206950263363048504L;

	private int apertureSize = 3;
	private double threshold1 = 100.0;
	private double threshold2 = 100.0;

	@Override
	public void filter(final IplImage original, final IplImage edge) {
		// Aktuelles Bild in Graustufen umwandeln
		cvCvtColor(original, edge, CV_BGR2GRAY);

		// Graustufenbild kantenfiltern
		cvCanny(edge, edge, threshold1, threshold2, apertureSize);
	}

	@Override
	public EdgeFilterType getFilterType() {
		return EdgeFilterType.Canny;
	}

}
